package com.youease.chris.control
{
	import com.youease.chris.model.proxy.ProjectDataProxy;
	import com.youease.chris.model.vo.ProjectData;
	
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	public class CreateProjectCommand extends SimpleCommand implements ICommand
	{
		public static const CREATE_PROJECT:String = "create_project";
		public static const PROJECT_NAME_NULL:String = "project_name_null";
		public static const CREATE_PROJECT_COMPLETE:String = "create_project_complete";
		
		public function CreateProjectCommand()
		{
			super();
		}
		
		override public function execute(notification:INotification):void {
			var projectName:String = notification.getBody() as String;
			this.facade.registerProxy(new ProjectDataProxy(new ProjectData(projectName)));
			sendNotification(CREATE_PROJECT_COMPLETE);
		}
	}
}